package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Notification;
import com.example.demo.mapper.NotificationMapper;
import com.example.demo.service.INotificationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author demo
 * @since 2025-03-04
 */
@Service
public class NotificationServiceImpl extends ServiceImpl<NotificationMapper, Notification> implements INotificationService {

    @Resource
    private NotificationMapper notificationMapper;
    @Override
    public boolean sendNotification(String userId, String content) {
        // 具体实现代码（例如写入数据库）
        Notification notification = new Notification();
        notification.setUserId(userId);
        notification.setContent(content);
        notification.setCreateTime(LocalDateTime.now());
        return notificationMapper.insert(notification) > 0;
    }
}
